<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE" />
        <title>沙盒缓存 | 多线程</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.0.1">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
        
    
    
    <link rel="next" href="./async_pictures-12-summary.html" />
    
    
    <link rel="prev" href="./async_pictures-10-black_list.html" />
    

        
    </head>
    <body>
        
        
    <link rel="stylesheet" href="gitbook/style.css">
    
    

        
    <div class="book" data-level="0.6.11" data-basepath="." data-revision="Thu Jun 04 2015 06:22:37 GMT+0800 (CST)">
    

<div class="book-summary">
    <div class="book-search">
        <input type="text" placeholder="Type to search" class="form-control" />
    </div>
    <ul class="summary">
        
        
        
        

        

        
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="./index.html">
                        <i class="fa fa-check"></i>
                        
                        多线程
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.1" data-path="multithread.html">
            
                
                    <a href="./multithread.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.1.</b>
                        
                        多线程
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.2" data-path="pthread.html">
            
                
                    <a href="./pthread.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.2.</b>
                        
                        pthread
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.3" data-path="nsthread.html">
            
                
                    <a href="./nsthread.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.</b>
                        
                        NSThread
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.3.1" data-path="nsthread-01-start_thread.html">
            
                
                    <a href="./nsthread-01-start_thread.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.1.</b>
                        
                        创建线程的方式
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.3.2" data-path="nsthread-02-target.html">
            
                
                    <a href="./nsthread-02-target.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.2.</b>
                        
                        NSThread 的 Target
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.3.3" data-path="nsthread-03-thread_status.html">
            
                
                    <a href="./nsthread-03-thread_status.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.3.</b>
                        
                        线程状态
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.3.4" data-path="nsthread-04-properties.html">
            
                
                    <a href="./nsthread-04-properties.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.4.</b>
                        
                        线程属性
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.3.5" data-path="nsthread-05-resource.html">
            
                
                    <a href="./nsthread-05-resource.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.5.</b>
                        
                        资源共享
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.3.6" data-path="nsthread-06-atomic.html">
            
                
                    <a href="./nsthread-06-atomic.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.6.</b>
                        
                        原子属性
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.3.7" data-path="nsthread-07-communication.html">
            
                
                    <a href="./nsthread-07-communication.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.7.</b>
                        
                        线程间通讯
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="0.4" data-path="gcd.html">
            
                
                    <a href="./gcd.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.</b>
                        
                        GCD
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.4.1" data-path="gcd-01-sync&amp;async.html">
            
                
                    <a href="./gcd-01-sync&amp;async.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.1.</b>
                        
                        同步 &amp; 异步
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.2" data-path="gcd-02-block.html">
            
                
                    <a href="./gcd-02-block.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.2.</b>
                        
                        block
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.3" data-path="gcd-03-common_code.html">
            
                
                    <a href="./gcd-03-common_code.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.3.</b>
                        
                        GCD 常用代码
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.4" data-path="gcd-04-dispatch_queue_serial.html">
            
                
                    <a href="./gcd-04-dispatch_queue_serial.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.4.</b>
                        
                        串行队列
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.5" data-path="gcd-05-dispatch_queue_concurrent.html">
            
                
                    <a href="./gcd-05-dispatch_queue_concurrent.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.5.</b>
                        
                        并发队列
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.6" data-path="gcd-06-main_queue.html">
            
                
                    <a href="./gcd-06-main_queue.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.6.</b>
                        
                        主队列
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.7" data-path="gcd-07-sync_task.html">
            
                
                    <a href="./gcd-07-sync_task.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.7.</b>
                        
                        同步任务的作用
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.8" data-path="gcd-08-barrier_async.html">
            
                
                    <a href="./gcd-08-barrier_async.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.8.</b>
                        
                        Barrier 异步
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.9" data-path="gcd-09-global_queue.html">
            
                
                    <a href="./gcd-09-global_queue.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.9.</b>
                        
                        全局队列
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.10" data-path="gcd-10-delay.html">
            
                
                    <a href="./gcd-10-delay.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.10.</b>
                        
                        延迟操作
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.11" data-path="gcd-11-once.html">
            
                
                    <a href="./gcd-11-once.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.11.</b>
                        
                        一次性执行
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.4.12" data-path="gcd-12-group.html">
            
                
                    <a href="./gcd-12-group.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.4.12.</b>
                        
                        调度组
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="0.5" data-path="nsoperation.html">
            
                
                    <a href="./nsoperation.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.5.</b>
                        
                        NSOperation
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.5.1" data-path="nsoperation-01-basic.html">
            
                
                    <a href="./nsoperation-01-basic.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.5.1.</b>
                        
                        基本演练
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.5.2" data-path="nsoperation-02-advance.html">
            
                
                    <a href="./nsoperation-02-advance.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.5.2.</b>
                        
                        高级演练
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.5.3" data-path="nsoperation-03-nsoperation_vs_gcd.html">
            
                
                    <a href="./nsoperation-03-nsoperation_vs_gcd.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.5.3.</b>
                        
                        与 GCD 的对比
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.5.4" data-path="nsoperation-04-custom_operation.html">
            
                
                    <a href="./nsoperation-04-custom_operation.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.5.4.</b>
                        
                        自定义操作
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="0.6" data-path="async_pictures.html">
            
                
                    <a href="./async_pictures.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.</b>
                        
                        异步加载图片
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.6.1" data-path="async_pictures-01-preparation.html">
            
                
                    <a href="./async_pictures-01-preparation.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.1.</b>
                        
                        搭建界面&amp;数据准备
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.2" data-path="async_pictures-02-sync_picture.html">
            
                
                    <a href="./async_pictures-02-sync_picture.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.2.</b>
                        
                        同步加载图像
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.3" data-path="async_pictures-03-async_load_pictures.html">
            
                
                    <a href="./async_pictures-03-async_load_pictures.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.3.</b>
                        
                        异步加载图像
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.4" data-path="async_pictures-04-placeholder_picture.html">
            
                
                    <a href="./async_pictures-04-placeholder_picture.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.4.</b>
                        
                        占位图像
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.5" data-path="async_pictures-05-mvc.html">
            
                
                    <a href="./async_pictures-05-mvc.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.5.</b>
                        
                        MVC
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.6" data-path="async_pictures-06-operation_cache.html">
            
                
                    <a href="./async_pictures-06-operation_cache.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.6.</b>
                        
                        操作缓冲池
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.7" data-path="async_pictures-07-image_cache.html">
            
                
                    <a href="./async_pictures-07-image_cache.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.7.</b>
                        
                        图像缓冲池
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.8" data-path="async_pictures-08-refactor.html">
            
                
                    <a href="./async_pictures-08-refactor.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.8.</b>
                        
                        代码重构
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.9" data-path="async_pictures-09-memory_warning.html">
            
                
                    <a href="./async_pictures-09-memory_warning.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.9.</b>
                        
                        内存警告
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.10" data-path="async_pictures-10-black_list.html">
            
                
                    <a href="./async_pictures-10-black_list.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.10.</b>
                        
                        黑名单
                    </a>
                
            
            
        </li>
    
        <li class="chapter active" data-level="0.6.11" data-path="async_pictures-11-sandbox_cache.html">
            
                
                    <a href="./async_pictures-11-sandbox_cache.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.11.</b>
                        
                        沙盒缓存
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.12" data-path="async_pictures-12-summary.html">
            
                
                    <a href="./async_pictures-12-summary.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.12.</b>
                        
                        小结
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.6.13" data-path="async_pictures-13-sdwebimage.html">
            
                
                    <a href="./async_pictures-13-sdwebimage.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.6.13.</b>
                        
                        SDWebImage初体验
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="0.7" data-path="imitate_sdwebimage.html">
            
                
                    <a href="./imitate_sdwebimage.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.7.</b>
                        
                        仿SDWebImage
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.7.1" data-path="imitate_sdwebimage-01-download_operation.html">
            
                
                    <a href="./imitate_sdwebimage-01-download_operation.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.7.1.</b>
                        
                        下载操作
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.7.2" data-path="imitate_sdwebimage-02-test_download_operation.html">
            
                
                    <a href="./imitate_sdwebimage-02-test_download_operation.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.7.2.</b>
                        
                        测试下载操作
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.7.3" data-path="imitate_sdwebimage-03-download_manager.html">
            
                
                    <a href="./imitate_sdwebimage-03-download_manager.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.7.3.</b>
                        
                        下载管理器
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.7.4" data-path="imitate_sdwebimage-04-custom_imageview.html">
            
                
                    <a href="./imitate_sdwebimage-04-custom_imageview.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.7.4.</b>
                        
                        自定义 UIImageView
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="0.8" data-path="sdwebimage.html">
            
                
                    <a href="./sdwebimage.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.8.</b>
                        
                        SDWebImage
                    </a>
                
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.8.1" data-path="sdwebimage-01-framework.html">
            
                
                    <a href="./sdwebimage-01-framework.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.8.1.</b>
                        
                        第三方框架
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.8.2" data-path="sdwebimage-02-mask_enum.html">
            
                
                    <a href="./sdwebimage-02-mask_enum.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.8.2.</b>
                        
                        位移枚举
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.8.3" data-path="sdwebimage-03-nscache.html">
            
                
                    <a href="./sdwebimage-03-nscache.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.8.3.</b>
                        
                        NSCache
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.8.4" data-path="imitate_sdwebimage-05-questions.html">
            
                
                    <a href="./imitate_sdwebimage-05-questions.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.8.4.</b>
                        
                        SDWebImage常见面试题
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="0.9" data-path="runloop.html">
            
                
                    <a href="./runloop.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.9.</b>
                        
                        runloop
                    </a>
                
            
            
        </li>
    
        <li class="chapter " data-level="0.10" data-path="autoreleasepool.html">
            
                
                    <a href="./autoreleasepool.html">
                        <i class="fa fa-check"></i>
                        
                            <b>0.10.</b>
                        
                        自动释放池
                    </a>
                
            
            
        </li>
    

            </ul>
            
        </li>
    


        
        <li class="divider"></li>
        <li>
            <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                Published with GitBook
            </a>
        </li>
        
    </ul>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header">
    <!-- Actions Left -->
    <a href="#" class="btn pull-left toggle-summary" aria-label="Table of Contents"><i class="fa fa-align-justify"></i></a>
    <a href="#" class="btn pull-left toggle-search" aria-label="Search"><i class="fa fa-search"></i></a>
    
    <div id="font-settings-wrapper" class="dropdown pull-left">
        <a href="#" class="btn toggle-dropdown" aria-label="Font Settings"><i class="fa fa-font"></i>
        </a>
        <div class="dropdown-menu font-settings">
    <div class="dropdown-caret">
        <span class="caret-outer"></span>
        <span class="caret-inner"></span>
    </div>

    <div class="buttons">
        <button type="button" id="reduce-font-size" class="button size-2">A</button>
        <button type="button" id="enlarge-font-size" class="button size-2">A</button>
    </div>

    <div class="buttons font-family-list">
        <button type="button" data-font="0" class="button">Serif</button>
        <button type="button" data-font="1" class="button">Sans</button>
    </div>

    <div class="buttons color-theme-list">
        <button type="button" id="color-theme-preview-0" class="button size-3" data-theme="0">White</button>
        <button type="button" id="color-theme-preview-1" class="button size-3" data-theme="1">Sepia</button>
        <button type="button" id="color-theme-preview-2" class="button size-3" data-theme="2">Night</button>
    </div>
</div>

    </div>

    <!-- Actions Right -->
    
    <div class="dropdown pull-right">
        <a href="#" class="btn toggle-dropdown" aria-label="Share"><i class="fa fa-share-alt"></i>
        </a>
        <div class="dropdown-menu font-settings dropdown-left">
            <div class="dropdown-caret">
                <span class="caret-outer"></span>
                <span class="caret-inner"></span>
            </div>
            <div class="buttons">
                <button type="button" data-sharing="twitter" class="button">
                    Share on Twitter
                </button>
                <button type="button" data-sharing="google-plus" class="button">
                    Share on Google
                </button>
                <button type="button" data-sharing="facebook" class="button">
                    Share on Facebook
                </button>
                <button type="button" data-sharing="weibo" class="button">
                    Share on Weibo
                </button>
                <button type="button" data-sharing="instapaper" class="button">
                    Share on Instapaper
                </button>
            </div>
        </div>
    </div>
    

    
    <a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Google"><i class="fa fa-google-plus"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Facebook"><i class="fa fa-facebook"></i></a>
    
    
    <a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Twitter"><i class="fa fa-twitter"></i></a>
    
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="./" >多线程</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="%E6%B2%99%E7%9B%92%E7%BC%93%E5%AD%98%E5%AE%9E%E7%8E%B0">&#x6C99;&#x76D2;&#x7F13;&#x5B58;&#x5B9E;&#x73B0;</h1>
<h2 id="%E6%B2%99%E7%9B%92%E7%9B%AE%E5%BD%95%E4%BB%8B%E7%BB%8D">&#x6C99;&#x76D2;&#x76EE;&#x5F55;&#x4ECB;&#x7ECD;</h2>
<ul>
<li>Documents<ul>
<li>&#x4FDD;&#x5B58;&#x7531;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x4EA7;&#x751F;&#x7684;&#x6587;&#x4EF6;&#x6216;&#x8005;&#x6570;&#x636E;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;&#x6D82;&#x9E26;&#x7A0B;&#x5E8F;&#x751F;&#x6210;&#x7684;&#x56FE;&#x7247;&#xFF0C;&#x6E38;&#x620F;&#x5173;&#x5361;&#x8BB0;&#x5F55;</li>
<li>iCloud &#x4F1A;&#x81EA;&#x52A8;&#x5907;&#x4EFD; Document &#x4E2D;&#x7684;&#x6240;&#x6709;&#x6587;&#x4EF6;</li>
<li>&#x5982;&#x679C;&#x4FDD;&#x5B58;&#x4E86;&#x4ECE;&#x7F51;&#x7EDC;&#x4E0B;&#x8F7D;&#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x5728;&#x4E0A;&#x67B6;&#x5BA1;&#x6279;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4F1A;&#x88AB;&#x62D2;&#xFF01;</li>
</ul>
</li>
<li><p>tmp</p>
<ul>
<li>&#x4E34;&#x65F6;&#x6587;&#x4EF6;&#x5939;&#xFF0C;&#x4FDD;&#x5B58;&#x4E34;&#x65F6;&#x6587;&#x4EF6;</li>
<li>&#x4FDD;&#x5B58;&#x5728; tmp &#x6587;&#x4EF6;&#x5939;&#x4E2D;&#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x7CFB;&#x7EDF;&#x4F1A;&#x81EA;&#x52A8;&#x56DE;&#x6536;&#xFF0C;&#x8B6C;&#x5982;&#x78C1;&#x76D8;&#x7A7A;&#x95F4;&#x7D27;&#x5F20;&#x6216;&#x8005;&#x91CD;&#x65B0;&#x542F;&#x52A8;&#x624B;&#x673A;</li>
<li>&#x7A0B;&#x5E8F;&#x5458;&#x4E0D;&#x9700;&#x8981;&#x7BA1; tmp &#x6587;&#x4EF6;&#x5939;&#x4E2D;&#x7684;&#x91CA;&#x653E;</li>
</ul>
</li>
<li><p>Caches</p>
<ul>
<li>&#x7F13;&#x5B58;&#xFF0C;&#x4FDD;&#x5B58;&#x4ECE;&#x7F51;&#x7EDC;&#x4E0B;&#x8F7D;&#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x540E;&#x7EED;&#x4ECD;&#x7136;&#x9700;&#x8981;&#x7EE7;&#x7EED;&#x4F7F;&#x7528;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;&#x7F51;&#x7EDC;&#x4E0B;&#x8F7D;&#x7684;&#x79BB;&#x7EBF;&#x6570;&#x636E;&#xFF0C;&#x56FE;&#x7247;&#xFF0C;&#x89C6;&#x9891;...</li>
<li>&#x7F13;&#x5B58;&#x76EE;&#x5F55;&#x4E2D;&#x7684;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E0D;&#x4F1A;&#x81EA;&#x52A8;&#x5220;&#x9664;&#xFF0C;&#x53EF;&#x4EE5;&#x505A;&#x79BB;&#x7EBF;&#x8BBF;&#x95EE;&#xFF01;</li>
<li><strong>&#x8981;&#x6C42;&#x7A0B;&#x5E8F;&#x5FC5;&#x9700;&#x63D0;&#x4F9B;&#x4E00;&#x4E2A;&#x5B8C;&#x5584;&#x7684;&#x6E05;&#x9664;&#x7F13;&#x5B58;&#x76EE;&#x5F55;&#x7684;&quot;&#x89E3;&#x51B3;&#x65B9;&#x6848;&quot;&#xFF01;</strong></li>
</ul>
</li>
<li><p>Preferences</p>
<ul>
<li>&#x7CFB;&#x7EDF;&#x504F;&#x597D;&#xFF0C;&#x7528;&#x6237;&#x504F;&#x597D;</li>
<li>&#x64CD;&#x4F5C;&#x662F;&#x901A;&#x8FC7; <code>[NSUserDefaults standardDefaults]</code> &#x6765;&#x76F4;&#x63A5;&#x64CD;&#x4F5C;</li>
</ul>
</li>
</ul>
<h3 id="ios-%E4%B8%8D%E5%90%8C%E7%89%88%E6%9C%AC%E9%97%B4%E6%B2%99%E7%9B%92%E7%9B%AE%E5%BD%95%E7%9A%84%E5%8F%98%E5%8C%96">iOS &#x4E0D;&#x540C;&#x7248;&#x672C;&#x95F4;&#x6C99;&#x76D2;&#x76EE;&#x5F55;&#x7684;&#x53D8;&#x5316;</h3>
<ul>
<li>iOS 7.0&#x53CA;&#x4EE5;&#x524D;&#x7248;&#x672C; <code>bundle</code> &#x76EE;&#x5F55;&#x548C;&#x6C99;&#x76D2;&#x76EE;&#x5F55;&#x662F;&#x5728;&#x4E00;&#x8D77;&#x7684;</li>
<li>iOS 8.0&#x4E4B;&#x540E;&#xFF0C;<code>bundle</code> &#x76EE;&#x5F55;&#x548C;&#x6C99;&#x76D2;&#x76EE;&#x5F55;&#x662F;&#x5206;&#x5F00;&#x7684;</li>
</ul>
<h2 id="nsstring-path">NSString+Path</h2>
<pre><code class="lang-objc"><span class="hljs-preprocessor">#import <span class="hljs-title">&quot;NSString+Path.h&quot;</span></span>

<span class="hljs-class"><span class="hljs-keyword">@implementation</span> <span class="hljs-title">NSString</span> (<span class="hljs-title">Path</span>)</span>

- (<span class="hljs-built_in">NSString</span> *)appendDocumentPath {
    <span class="hljs-built_in">NSString</span> *dir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, <span class="hljs-literal">YES</span>)<span class="hljs-variable">.lastObject</span>;
    <span class="hljs-keyword">return</span> [dir stringByAppendingPathComponent:<span class="hljs-keyword">self</span><span class="hljs-variable">.lastPathComponent</span>];
}

- (<span class="hljs-built_in">NSString</span> *)appendCachePath {
    <span class="hljs-built_in">NSString</span> *dir = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, <span class="hljs-literal">YES</span>)<span class="hljs-variable">.lastObject</span>;
    <span class="hljs-keyword">return</span> [dir stringByAppendingPathComponent:<span class="hljs-keyword">self</span><span class="hljs-variable">.lastPathComponent</span>];
}

- (<span class="hljs-built_in">NSString</span> *)appendTempPath {
    <span class="hljs-keyword">return</span> [NSTemporaryDirectory() stringByAppendingPathComponent:<span class="hljs-keyword">self</span><span class="hljs-variable">.lastPathComponent</span>];
}

<span class="hljs-keyword">@end</span>
</code></pre>
<h2 id="%E6%B2%99%E7%9B%92%E7%BC%93%E5%AD%98">&#x6C99;&#x76D2;&#x7F13;&#x5B58;</h2>
<ul>
<li>&#x5C06;&#x56FE;&#x50CF;&#x4FDD;&#x5B58;&#x81F3;&#x6C99;&#x76D2;</li>
</ul>
<pre><code class="lang-objc"><span class="hljs-keyword">if</span> (data != <span class="hljs-literal">nil</span>) {
    [data writeToFile:app<span class="hljs-variable">.icon</span><span class="hljs-variable">.appendCachePath</span> atomically:<span class="hljs-literal">true</span>];
}
</code></pre>
<ul>
<li>&#x68C0;&#x67E5;&#x6C99;&#x76D2;&#x7F13;&#x5B58;</li>
</ul>
<pre><code class="lang-objc"><span class="hljs-comment">// &#x5224;&#x65AD;&#x6C99;&#x76D2;&#x6587;&#x4EF6;&#x662F;&#x5426;&#x5B58;&#x5728;</span>
<span class="hljs-built_in">UIImage</span> *image = [<span class="hljs-built_in">UIImage</span> imageWithContentsOfFile:app<span class="hljs-variable">.icon</span><span class="hljs-variable">.appendCachePath</span>];
<span class="hljs-keyword">if</span> (image != <span class="hljs-literal">nil</span>) {
    <span class="hljs-built_in">NSLog</span>(<span class="hljs-string">@&quot;&#x4ECE;&#x6C99;&#x76D2;&#x52A0;&#x8F7D;&#x56FE;&#x50CF; ... %@&quot;</span>, app<span class="hljs-variable">.name</span>);
    <span class="hljs-comment">// &#x5C06;&#x56FE;&#x50CF;&#x6DFB;&#x52A0;&#x81F3;&#x56FE;&#x50CF;&#x7F13;&#x5B58;</span>
    [<span class="hljs-keyword">self</span><span class="hljs-variable">.imageCache</span> setObject:image forKey:app<span class="hljs-variable">.icon</span>];
    cell<span class="hljs-variable">.iconView</span><span class="hljs-variable">.image</span> = image;

    <span class="hljs-keyword">return</span> cell;
}
</code></pre>
<h1 id="ios6-%E7%9A%84%E9%80%82%E9%85%8D%E9%97%AE%E9%A2%98">iOS6 &#x7684;&#x9002;&#x914D;&#x95EE;&#x9898;</h1>
<p><strong>&#x9762;&#x8BD5;&#x9898;&#xFF1A;iOS 6.0 &#x7684;&#x7A0B;&#x5E8F;&#x76F4;&#x63A5;&#x8FD0;&#x884C;&#x5728; iOS 7.0 &#x7684;&#x7CFB;&#x7EDF;&#x4E2D;&#xFF0C;&#x901A;&#x5E38;&#x4F1A;&#x51FA;&#x73B0;&#x4EC0;&#x4E48;&#x95EE;&#x9898;</strong></p>
<ul>
<li><p>&#x72B6;&#x6001;&#x680F;&#x9AD8;&#x5EA6; 20 &#x4E2A;&#x70B9;&#x662F;&#x4E0D;&#x5305;&#x542B;&#x5728; <code>view.frame</code> &#x4E2D;&#x7684;&#xFF0C;<code>self.view</code> &#x7684;&#x5DE6;&#x4E0A;&#x89D2;&#x539F;&#x70B9;&#x7684;&#x5750;&#x6807;&#x4F4D;&#x7F6E;&#x662F;&#x4ECE;&#x72B6;&#x6001;&#x680F;&#x4E0B;&#x65B9;&#x5F00;&#x59CB;&#x8BA1;&#x7B97;</p>
<ul>
<li>iOS 6.0 &#x7A0B;&#x5E8F;&#x76F4;&#x63A5;&#x5728; iOS 7.0 &#x7684;&#x7CFB;&#x7EDF;&#x4E2D;&#x8FD0;&#x884C;&#x6700;&#x5E38;&#x89C1;&#x7684;&#x95EE;&#x9898;&#xFF0C;&#x5C31;&#x662F;&#x5C11;&#x4E86;20&#x4E2A;&#x70B9;</li>
</ul>
</li>
<li><p>&#x5982;&#x679C;&#x5305;&#x542B;&#x6709; <code>UINavigationController</code>&#xFF0C;<code>self.view</code>&#x7684;&#x5DE6;&#x4E0A;&#x89D2;&#x5750;&#x6807;&#x539F;&#x70B9;&#x4ECE;&#x72B6;&#x6001;&#x680F;&#x4E0B;&#x65B9;&#x5F00;&#x59CB;&#x8BA1;&#x7B97;</p>
<ul>
<li>&#x56E0;&#x6B64;&#xFF0C;iOS 6.0&#x7684;&#x7CFB;&#x7EDF;&#x65E0;&#x6CD5;&#x5B9E;&#x73B0;&#x8868;&#x683C;&#x4ECE;&#x5BFC;&#x822A;&#x6761;&#x4E0B;&#x65B9;&#x7A7F;&#x900F;&#x7684;&#x6548;&#x679C;</li>
</ul>
</li>
<li><p>&#x5982;&#x679C;&#x5305;&#x542B;&#x6709; <code>UITabBarController</code>&#xFF0C;<code>self.view</code>&#x7684;&#x5E95;&#x90E8;&#x4E0D;&#x5305;&#x542B; TabBar</p>
<ul>
<li>&#x56E0;&#x6B64;&#xFF0C;iOS 6.0&#x7684;&#x7CFB;&#x7EDF;&#x65E0;&#x6CD5;&#x5B9E;&#x73B0;&#x8868;&#x683C;&#x4ECE; TabBar &#x4E0B;&#x65B9;&#x7A7F;&#x900F;&#x6548;&#x679C;</li>
</ul>
</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="./async_pictures-10-black_list.html" class="navigation navigation-prev " aria-label="Previous page: 黑名单"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="./async_pictures-12-summary.html" class="navigation navigation-next " aria-label="Next page: 小结"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="gitbook/app.js"></script>

<script>
require(["gitbook"], function(gitbook) {
    var config = {"fontSettings":{"theme":null,"family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
